<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!
DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>系统登录 - 超市账单管理系统</title>
    <link rel="stylesheet" href="css/style.css"/>
    <script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
	function yanzheng() {
		var userCode = $("#userCode").val();
		if (userCode == null || userCode == "") {
			$("#MsgUserCode").html("用户名不能为空！");
			return;
		} else {
			$.ajax({
				"url" : "yanZhengUserCodeExists.do",
				"type" : "get",
				"data" : "userCode=" + userCode,
				"dataType" : "json",
				"success" : function(data) {
				//alert(data);
					if (data.msg == "exist") {
						$("#MsgUserCode").html("");
					} else {
						$("#MsgUserCode").html("该用户名不存在！");
					}
				}
			})

		}
	}
</script>
</head>
<body class="login_bg">
    <section class="loginBox">
        <header class="loginHeader">
            <h1>超市账单管理系统</h1>
        </header>
        <section class="loginCont">
            <form class="loginForm" action="user-login.do?opr=login" method="post">
               <span id="MsgUserCode" style="color:red">${exception.message }</span>
                <div class="inputbox">
                
                    <label for="user">用户名：</label>
                    <input id="userCode" type="text" name="userCode" value="${userCode}" placeholder="请输入用户名" required onblur="yanzheng()"/>
                </div>
                <div class="inputbox">
                    <label for="mima">密码：</label>
                    <input id="mima" type="password" name="userPassword" placeholder="请输入密码" required/>
                </div>
                <div class="subBtn">
                    <input type="submit" value="登录" />
                    <input type="reset" value="重置"/>
                </div>

            </form>
        </section>
    </section>

</body>
</html>